Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed failing test cases #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sankarvj
Copy link

@sankarvj sankarvj commented Aug 2, 2023

Fixed following test cases in golang server

Test 2: Expects results for the case-sensitive query.
The suffixarray package indexes the words as we passed. To ensure case insensitivity, I converted the entire doc to lowercase before passing it to the index function. Additionally, I converted the query string to lowercase before calling the lookup function to avoid any case-sensitive failures.

Test 3: Expects 20 results for the query drunk.
The suffixarray package returns the complete list of indexes it matches. To restrict the output to the first 20 results, I included a constant with a value of 20 and returned the subset if the indexes had more than 20 results.

Fixed following test cases in JS

Test 3: Expects load more to append results.To enable load more, I have received a page number from the client and implemented pagination logic on the server side. The page number will be reset when the client initiates a new search and will automatically increment each time the "load more" function is triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant